package com.damai.controller;

import com.damai.common.ApiResponse;
import com.damai.dto.TicketUserDto;
import com.damai.service.TicketUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ticket/user")
@Tag(name = "ticket-user", description = "购票人")
public class TicketUserController {

    @Autowired
    private TicketUserService ticketUserService;

    @Operation(summary = "添加购票人")
    @PostMapping("/add")
    public ApiResponse<Void> add(@Valid @RequestBody TicketUserDto ticketUserDto) {
        ticketUserService.add(ticketUserDto);
        return ApiResponse.ok();
    }
}
